package com.videoplat.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.ParameterAware;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;



import com.opensymphony.xwork2.ActionSupport;

public class BaseAction extends ActionSupport implements ServletRequestAware,ServletResponseAware,ParameterAware{

	private static final long serialVersionUID = 1L;
	/**
	 * 转发（页面跳转）
	 */
	protected static String ZHF_PATH = "ZHF";
	/**
	 * 重定向（页面跳转）
	 */
	protected static String CDX_PATH = "CDX";
	
	protected HttpServletRequest request;
	protected HttpServletResponse response;

	public void setServletResponse(HttpServletResponse response) {
		this.response = response;
	}

	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}
	public HttpServletRequest getRequest() {
		request = ServletActionContext.getRequest();
		return request;
	}
	/**
	 * @return the response
	 */
	public HttpServletResponse getResponse() {
		response = ServletActionContext.getResponse();
		return response;
	}

	public void setParameters(Map<String, String[]>  parameters) {
		// TODO Auto-generated method stub
		parameters.remove("pager.offset");
	}
}
